package com.aaa.coolweather;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;

import com.aaa.coolweather.db.greendao.demo1.DbController;
import com.aaa.coolweather.db.greendao.demo1.PersonInfor;

import java.util.List;

public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        for (int i = 0; i < 1000; i++) {
            PersonInfor personInfor = new PersonInfor(null, "no_" + i, "张三" + System.currentTimeMillis(), "男");
            DbController.getInstance(getApplicationContext()).insertOrReplace(personInfor);
        }

        List<PersonInfor> personInfors = DbController.getInstance(getApplicationContext()).searchAll();
        for (PersonInfor infor : personInfors) {
            Log.d(TAG, "onCreate: getName=" + infor.getName());
        }
    }
}
